<?php
/**
 * Created by PhpStorm.
 * User: bobfeng
 * Date: 2018/3/16
 * Time: 上午11:01
 */

namespace app\controllers;


use app\librarys\PayProController;
use app\models\db\TUser;
use app\models\TUserExt;
use yii\data\Pagination;

class UserController extends PayProController
{
   public function actionUser(){
       $request = \Yii::$app->request;

       $name = $request->get('name');

       echo '222';

       $count = TUserExt::getTUserCount($name);
       $pagination = new Pagination([
           'totalCount' => $count
       ]);
       $items = TUserExt::getTUserList($pagination->page, $pagination->pageSize, $name);

       return $this->render('user',
           [
               'items' => $items,
               'name' => $name,
               'pagination' => $pagination
           ]);
   }

    public function actionTUserPartial()
    {
        $this->layout = false;
        $request = \Yii::$app->request;
        $id = $request->post('id');

        $item = TUserExt::getTUserById($id);

        return $this->render('tuser-partial',
            [
                'item' => $item
//                'expresses' => $expresses
            ]
        );
    }
}